package com.isfto.service.impl;


import com.isfto.dao.AbrsDao;
import com.isfto.dao.FlightInfoDao;
import com.isfto.entity.tablepojo.ABRS;
import com.isfto.service.AbrsService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AbrsServiceImpl implements AbrsService {
    @Resource
    AbrsDao abrsDao;

    @Resource
    FlightInfoDao flightInfoDao;

    @Override
    public List<ABRS> abrsInfo() {
        List<ABRS> abrs = abrsDao.abrsInfo();
        for (int i = 0; i < abrs.size(); i++) {
            ABRS abrs1 = flightInfoDao.abrsInfo(abrs.get(i).getNumber());
            abrs.get(i).setNumber(abrs1.getCnnm());
        }
        return  abrs;
    }

    @Override
    public List<ABRS> abrsOutInfo() {
        List<ABRS> abrs = abrsDao.abrsOutInfo();
        for (int i = 0; i < abrs.size(); i++) {
            ABRS abrs1 = flightInfoDao.abrsInfo(abrs.get(i).getNumber());
            abrs.get(i).setNumber(abrs1.getCnnm());
        }
        return abrs;
    }
}
